import request from "@/utils/request";

export const workOrderManagement = {
  contextPath: '/patorl', //按照实际应用修改成微服务的名�?//
  getdata: (data) => { //分页查询
    return request({
      url: workOrderManagement.contextPath + '/en-patrol-task/page',
      method: 'POST',
      data: data
    })
  },
  updateData: (data) => { //修改，删除
    return request({
      url: workOrderManagement.contextPath + '/en-patrol-task/update',
      method: 'POST',
      data: data
    })
  },
  sendOrder: (data) => { //派单
    return request({
      url: workOrderManagement.contextPath + '/en-patrol-task/sendOrder',
      method: 'POST',
      data: data
    })
  },
  getTaskOperateList: (code) => { //获取操作节点
    return request({
      url: workOrderManagement.contextPath + '/en-patrol-task/getTaskProcess/' + code,
      method: 'POST',
      // data: data
    })
  },
  getTaskEquipList: (taskNo) => { //根据任务编号获取设备列表
    return request({
      url: workOrderManagement.contextPath + '/en-patrol-task/getTaskEquipList/' + taskNo,
      method: 'POST',

    })
  },
  //根据任务编号查询缺陷隐患列表
  getTaskDefectList: (taskNo) => {
    return request({
      url: workOrderManagement.contextPath + '/en-patrol-task/getTaskDefectList/' + taskNo,
      method: 'POST'
    })
  },
  //根据任务编号查询缺陷隐患列表
  getDefect: (data) => {
    return request({
      url: workOrderManagement.contextPath + '/en-stock-equip-defect/page',
      method: 'POST',
      data: data
    })
  },
  //已处理缺陷隐患列表
  getTaskHandleDefectList: (taskNo) => {
    return request({
      url: workOrderManagement.contextPath + '/en-patrol-task/getTaskHandleDefectList/' + taskNo,
      method: 'POST'
    })
  },
  getJfByGldw: (code) => { //管理单位联动库房//
    return request({
      url: workOrderManagement.contextPath + '/en-wz-jfgl/ywdw/' + code,
      method: 'POST'
    })
  },
  getById: (code) => {
    return request({
      url: workOrderManagement.contextPath + '/en-patrol-task/' + code,
      method: 'POST'
    })
  },
  exportXls: (data) => { //导出//
    return request({
      url: workOrderManagement.contextPath + '/en-patrol-task/exportExcel',
      method: 'POST',
      data: data,
      responseType: 'blob'
    })
  },
  getElectricityCollectionData: (taskNo) => {
    return request({
      url: workOrderManagement.contextPath + '/en-patrol-task-electricity/getByTaskNo/' + taskNo,
      method: 'GET'
    })
  },
  updateDefect: (data) => {
    return request({
      url: '/equip/en-stock-equip-defect/update',
      method: 'POST',
      data: data
    })
  },
  getEquip: (data) => {
    return request({
      url: '/equip/en-stock-equip-defect/update',
      method: 'POST',
      data: data
    })
  },
  getEquipList: (data) => {
    return request({
      url: workOrderManagement.contextPath + '/en-patrol-task-equip/page',
      method: 'POST',
      data: data
    })
  },
  //人员轨迹
  gettrackList: (data) => {
    return request({
      // url: workOrderManagement.contextPath + '/en-patrol-task/energyPtgis'+data.endTime +data.startTime +data.yhid,
      url: workOrderManagement.contextPath + '/en-patrol-task/energyPtgis?endTime=' + data.endTime + '&startTime=' + data.startTime + '&yhid=' + data.yhid,

      method: 'POST',
      // data:data
    })
  }
}
